package Branch_And_Bound;

// 图中的边的类
public class Arc {
    private int from;
    private int to;
    private int weight;

    public Arc(int from, int to, int weight) {
        this.from = from;
        this.to = to;
        this.weight = weight;
    }

    public Arc(Arc a) {
        this.from = a.from;
        this.to = a.to;
        this.weight = a.weight;
    }

    public Arc(int from, int to) {
        this.from = from;
        this.to = to;
        this.weight = 0;
    }

    public int getFrom() {
        return from;
    }

    public int getTo() {
        return to;
    }

    public int getWeight() {
        return weight;
    }

    public boolean equals(Arc o) {
        boolean flag = false;
        if (this.getFrom() == o.getFrom() && this.getTo() == o.getTo() && this.getWeight() == o.getWeight()) {
            flag = true;
        }
        return flag;
    }
}